package lleida.festamajor.model;

public class Event implements Comparable<Event>{
	protected String name;
	protected Place place;
	protected Date date;
	protected String time;
	protected String description;
	protected Category category;
	protected boolean free;
	
	public Event(String name, Place place, Date date, String time, String description, Category category, boolean free) {
		this.name = name;
		this.place = place;
		this.date = date;
		this.time = time;
		this.description = description;
		this.category = category;
		this.free = free;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public Place getPlace() {
		return place;
	}
	
	public void setPlace(Place place) {
		this.place = place;
	}
	
	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getTime() {
		return time;
	}
	
	public void setTime(String time) {
		this.time = time;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	public boolean isFree() {
		return free;
	}

	public void setFree(boolean free) {
		this.free = free;
	}

	public int compareTo(Event another) {
		if (time.compareTo("06:00") < 0 && another.getTime().compareTo("06:00") > 0) return 1;
		else if (time.compareTo("06:00") > 0 && another.getTime().compareTo("06:00") < 0) return -1;
		return this.time.compareTo(another.getTime());
	}
}
